home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / prim / frame.el < prev    next >
Encoding:
Text File  |  1995-08-18  |  20.4 KB  |  555 lines

  1. ;;; frame.el --- multi-frame management independent of window systems.
  2.  
  3. ;;;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  4.  
  5. ;; Maintainer: FSF
  6. ;; Keywords: internal
  7.  
  8. ;; This file is part of XEmacs.
  9.  
  10. ;; XEmacs is free software; you can redistribute it and/or modify it
  11. ;; under the terms of the GNU General Public License as published by
  12. ;; the Free Software Foundation; either version 2, or (at your option)
  13. ;; any later version.
  14.  
  15. ;; XEmacs is distributed in the hope that it will be useful, but
  16. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18. ;; General Public License for more details.
  19.  
  20. ;; You should have received a copy of the GNU General Public License
  21. ;; along with XEmacs; see the file COPYING.  If not, write to the Free
  22. ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  
  24. ;;; Code:
  25.  
  26. (defvar select-frame-hook nil
  27.   "Function or functions to run just after a new frame is given the focus.
  28. Note that calling `select-frame' does not necessarily set the focus:
  29. The actual window-system focus will not be changed until the next time
  30. that XEmacs is waiting for an event, and even then, the window manager
  31. may refuse the focus-change request.")
  32.  
  33. (defvar deselect-frame-hook nil
  34.   "Function or functions to run just before a frame loses the focus.
  35. See `select-frame-hook'.")
  36.  
  37. (defvar initial-frame-alist nil
  38.   "Alist of default values for the first frame.
  39. This may be set by the window-system-specific init file.")
  40.  
  41.  
  42.  
  43. ;;;; Creating the initial window-system frame
  44.  
  45. (defun frame-initialize ()
  46.   ;; In batch mode, we actually use the initial terminal device for output.
  47.   (if (not (noninteractive))
  48.       (progn
  49.     ;; Don't call select-frame here - focus is a matter of WM policy.
  50.     (make-frame initial-frame-alist
  51.             (car (delq terminal-device (device-list))))
  52.     (delete-device terminal-device)
  53.     (setq terminal-frame nil))))
  54.  
  55.  
  56. ;;;; Creation of additional frames, and other frame miscellanea
  57.  
  58. (defun get-other-frame ()
  59.  "Return some frame other than the current frame, creating one if necessary."
  60.   (let* ((this (selected-frame))
  61.      ;; search visible frames first
  62.      (next (next-frame this 'visible)))
  63.     ;; then search iconified frames
  64.     (if (eq this next)
  65.     (setq next (next-frame this nil)))
  66.     (if (eq this next)
  67.     ;; otherwise, make a new frame
  68.     (make-frame)
  69.       next)))
  70.  
  71. (defun next-multiframe-window ()
  72.   "Select the next window, regardless of which frame it is on."
  73.   (interactive)
  74.   (select-window (next-window (selected-window)
  75.                   (> (minibuffer-depth) 0)
  76.                   t)))
  77.  
  78. (defun previous-multiframe-window ()
  79.   "Select the previous window, regardless of which frame it is on."
  80.   (interactive)
  81.   (select-window (previous-window (selected-window)
  82.                   (> (minibuffer-depth) 0)
  83.                   t)))
  84.  
  85. (defun frame-list ()
  86.   "Return a list of all frames on all devices."
  87.   (apply 'append (mapcar 'device-frame-list (device-list))))
  88.  
  89. ;; Alias, kept temporarily.
  90. (defalias 'new-frame 'make-frame)
  91.  
  92. (defun filtered-frame-list (predicate)
  93.   "Return a list of all live frames which satisfy PREDICATE."
  94.   (let ((frames (frame-list))
  95.     good-frames)
  96.     (while (consp frames)
  97.       (if (funcall predicate (car frames))
  98.       (setq good-frames (cons (car frames) good-frames)))
  99.       (setq frames (cdr frames)))
  100.     good-frames))
  101.  
  102. ;(defun minibuffer-frame-list ()
  103. ;  "Return a list of all frames with their own minibuffers."
  104. ;  (filtered-frame-list
  105. ;   (function (lambda (frame)
  106. ;           (eq frame (window-frame (minibuffer-window frame)))))))
  107.  
  108. ;(defun frame-remove-geometry-params (param-list)
  109. ;  "Return the parameter list PARAM-LIST, but with geometry specs removed.
  110. ;This deletes all bindings in PARAM-LIST for `top', `left', `width',
  111. ;and `height' parameters.
  112. ;XEmacs uses this to avoid overriding explicit moves and resizings from
  113. ;the user during startup."
  114. ;  (setq param-list (cons nil param-list))
  115. ;  (let ((tail param-list))
  116. ;    (while (consp (cdr tail))
  117. ;      (if (and (consp (car (cdr tail)))
  118. ;           (memq (car (car (cdr tail))) '(height width top left)))
  119. ;      (setcdr tail (cdr (cdr tail)))
  120. ;    (setq tail (cdr tail)))))
  121. ;  (cdr param-list))
  122.  
  123.  
  124. (defun other-frame (arg)
  125.   "Select the ARG'th different visible frame, and raise it.
  126. All frames are arranged in a cyclic order.
  127. This command selects the frame ARG steps away in that order.
  128. A negative ARG moves in the opposite order."
  129.   (interactive "p")
  130.   (let ((frame (selected-frame)))
  131.     (while (> arg 0)
  132.       (setq frame (next-frame frame 'visible))
  133.       (setq arg (1- arg)))
  134.     (while (< arg 0)
  135.       (setq frame (previous-frame frame 'visible))
  136.       (setq arg (1+ arg)))
  137.     (raise-frame frame)
  138.     (select-frame frame)
  139.     ))
  140.  
  141. ;; utility functions
  142. (defun device-or-frame-p (object)
  143.   "Return non-nil if OBJECT is a device or frame."
  144.   (or (devicep object)
  145.       (framep object)))
  146.  
  147. (defun device-or-frame-type (device-or-frame)
  148.   "Return the type (e.g. `x' or `tty') of DEVICE-OR-FRAME.
  149. DEVICE-OR-FRAME should be a device or a frame object.  See `device-type'
  150. for a description of the possible types."
  151.   (if (devicep device-or-frame)
  152.       (device-type device-or-frame)
  153.     (frame-type device-or-frame)))
  154.  
  155.  
  156. ;;;; Frame configurations
  157.  
  158. ;; This stuff doesn't quite work yet - feel free to fix it
  159.  
  160. ;(defun current-frame-configuration ()
  161. ;  "Return a list describing the positions and states of all frames.
  162. ;Its car is `frame-configuration'.
  163. ;Each element of the cdr is a list of the form (FRAME ALIST WINDOW-CONFIG),
  164. ;where
  165. ;  FRAME is a frame object,
  166. ;  ALIST is an association list specifying some of FRAME's parameters, and
  167. ;  WINDOW-CONFIG is a window configuration object for FRAME."
  168. ;  (cons 'frame-configuration
  169. ;    (mapcar (function
  170. ;         (lambda (frame)
  171. ;           (list frame
  172. ;             (frame-parameters frame)
  173. ;             (current-window-configuration frame))))
  174. ;        (frame-list))))
  175.  
  176. ;(defun set-frame-configuration (configuration &optional nodelete)
  177. ;  "Restore the frames to the state described by CONFIGURATION.
  178. ;Each frame listed in CONFIGURATION has its position, size, window
  179. ;configuration, and other parameters set as specified in CONFIGURATION.
  180. ;Ordinarily, this function deletes all existing frames not
  181. ;listed in CONFIGURATION.  But if optional second argument NODELETE
  182. ;is given and non-nil, the unwanted frames are iconified instead."
  183. ;  (or (frame-configuration-p configuration)
  184. ;      (signal 'wrong-type-argument
  185. ;          (list 'frame-configuration-p configuration)))
  186. ;  (let ((config-alist (cdr configuration))
  187. ;    frames-to-delete)
  188. ;    (mapcar (function
  189. ;         (lambda (frame)
  190. ;           (let ((parameters (assq frame config-alist)))
  191. ;         (if parameters
  192. ;             (progn
  193. ;               (modify-frame-parameters
  194. ;            frame
  195. ;            ;; Since we can't set a frame's minibuffer status, 
  196. ;            ;; we might as well omit the parameter altogether.
  197. ;            (let* ((parms (nth 1 parameters))
  198. ;                   (mini (assq 'minibuffer parms)))
  199. ;              (if mini (setq parms (delq mini parms)))
  200. ;              parms))
  201. ;               (set-window-configuration (nth 2 parameters)))
  202. ;           (setq frames-to-delete (cons frame frames-to-delete))))))
  203. ;        (frame-list))
  204. ;    (if nodelete
  205. ;    ;; Note: making frames invisible here was tried
  206. ;    ;; but led to some strange behavior--each time the frame
  207. ;    ;; was made visible again, the window manager asked afresh
  208. ;    ;; for where to put it.
  209. ;    (mapcar 'iconify-frame frames-to-delete)
  210. ;      (mapcar 'delete-frame frames-to-delete))))
  211.  
  212. ;(defun frame-configuration-p (object)
  213. ;  "Return non-nil if OBJECT seems to be a frame configuration.
  214. ;Any list whose car is `frame-configuration' is assumed to be a frame
  215. ;configuration."
  216. ;  (and (consp object)
  217. ;       (eq (car object) 'frame-configuration)))
  218.  
  219.  
  220. ;;; Iconifying emacs.
  221. ;;;
  222. ;;; The function iconify-emacs replaces every non-iconified emacs window
  223. ;;; with a *single* icon.  Iconified emacs windows are left alone.  When
  224. ;;; emacs is in this globally-iconified state, de-iconifying any emacs icon
  225. ;;; will uniconify all frames that were visible, and iconify all frames
  226. ;;; that were not.  This is done by temporarily changing the value of
  227. ;;; `map-frame-hook' to `deiconify-emacs' (which should never be called 
  228. ;;; except from the map-frame-hook while emacs is iconified).
  229. ;;;
  230. ;;; The title of the icon representing all emacs frames is controlled by
  231. ;;; the variable `icon-name'.  This is done by temporarily changing the
  232. ;;; value of `frame-icon-title-format'.  Unfortunately, this changes the
  233. ;;; titles of all emacs icons, not just the "big" icon.
  234. ;;;
  235. ;;; It would be nice if existing icons were removed and restored by
  236. ;;; iconifying the emacs process, but I couldn't make that work yet.
  237.  
  238. (defvar icon-name nil) ; set this at run time, not load time.
  239.  
  240. (defvar iconification-data nil)
  241.  
  242. (defun iconify-emacs ()
  243.   "Replace every non-iconified FRAME with a *single* icon.
  244. Iconified frames are left alone.  When XEmacs is in this
  245. globally-iconified state, de-iconifying any emacs icon will uniconify
  246. all frames that were visible, and iconify all frames that were not."
  247.   (interactive)
  248.   (if iconification-data (error "already iconified?"))
  249.   (let* ((frames (frame-list))
  250.      (rest frames)
  251.      (me (selected-frame))
  252.      frame)
  253.     (while rest
  254.       (setq frame (car rest))
  255.       (setcar rest (cons frame (frame-visible-p frame)))
  256. ;      (if (memq (cdr (car rest)) '(icon nil))
  257. ;      (progn
  258. ;        (make-frame-visible frame) ; deiconify, and process the X event
  259. ;        (sleep-for 500 t) ; process X events; I really want to XSync() here
  260. ;        ))
  261.       (or (eq frame me) (make-frame-invisible frame))
  262.       (setq rest (cdr rest)))
  263.     (or (boundp 'map-frame-hook) (setq map-frame-hook nil))
  264.     (or icon-name
  265.     (setq icon-name (concat invocation-name " @ " (system-name))))
  266.     (setq iconification-data
  267.         (list frame-icon-title-format map-frame-hook frames)
  268.       frame-icon-title-format icon-name
  269.       map-frame-hook 'deiconify-emacs)
  270.     (iconify-frame me)))
  271.  
  272. (defun deiconify-emacs (&optional ignore)
  273.   (or iconification-data (error "not iconified?"))
  274.   (setq frame-icon-title-format (car iconification-data)
  275.     map-frame-hook (car (cdr iconification-data))
  276.     iconification-data (car (cdr (cdr iconification-data))))
  277.   (while iconification-data
  278.     (let ((visibility (cdr (car iconification-data))))
  279.       (cond ((eq visibility 't)
  280.          (make-frame-visible (car (car iconification-data))))
  281. ;        (t ;; (eq visibility 'icon)
  282. ;         (make-frame-visible (car (car iconification-data)))
  283. ;         (sleep-for 500 t) ; process X events; I really want to XSync() here
  284. ;         (iconify-frame (car (car iconification-data))))
  285.         ;; (t nil)
  286.         ))
  287.     (setq iconification-data (cdr iconification-data))))
  288.  
  289. (defun suspend-or-iconify-emacs ()
  290.   "Calls iconify-emacs if frame is an X frame, otherwise calls suspend-emacs"
  291.   (interactive)
  292.   (if (eq (frame-type (selected-frame)) 'x)
  293.       (iconify-emacs)
  294.     (suspend-emacs)))
  295.  
  296.  
  297. ;;; auto-raise and auto-lower
  298.  
  299. (defvar auto-raise-frame nil
  300.   "*If true, frames will be raised to the top when selected.
  301. Under X, most ICCCM-compliant window managers will have an option to do this
  302. for you, but this variable is provided in case you're using a broken WM.")
  303.  
  304. (defvar auto-lower-frame nil
  305.   "*If true, frames will be lowered to the bottom when no longer selected.
  306. Under X, most ICCCM-compliant window managers will have an option to do this
  307. for you, but this variable is provided in case you're using a broken WM.")
  308.  
  309. (defun default-select-frame-hook ()
  310.   "Implements the `auto-raise-frame' variable.
  311. For use as the value of `select-frame-hook'."
  312.   (if auto-raise-frame (raise-frame (selected-frame))))
  313.  
  314. (defun default-deselect-frame-hook ()
  315.   "Implements the `auto-lower-frame' variable.
  316. For use as the value of `deselect-frame-hook'."
  317.   (if auto-lower-frame (lower-frame (selected-frame))))
  318.  
  319. (or select-frame-hook
  320.     (add-hook 'select-frame-hook 'default-select-frame-hook))
  321.  
  322. (or deselect-frame-hook
  323.     (add-hook 'deselect-frame-hook 'default-deselect-frame-hook))
  324.  
  325.  
  326. ;;; Application-specific frame-management
  327.  
  328. (defvar get-frame-for-buffer-default-frame-name nil
  329.   "The default frame to select; see doc of `get-frame-for-buffer'.")
  330.  
  331. (defvar get-frame-for-buffer-default-instance-limit nil)
  332.  
  333. (defun get-frame-name-for-buffer (buffer)
  334.   (let ((mode (and (get-buffer buffer)
  335.            (save-excursion (set-buffer buffer)
  336.                    major-mode))))
  337.     (or (get mode 'frame-name)
  338.     get-frame-for-buffer-default-frame-name)))
  339.  
  340. (defun get-frame-for-buffer-sorted-frame-list ()
  341.   (sort (frame-list)
  342.     #'(lambda (s1 s2)
  343.         (cond ((frame-totally-visible-p s2)
  344.            nil)
  345.           ((not (frame-visible-p s2))
  346.            (frame-visible-p s1))
  347.           ((not (frame-totally-visible-p s2))
  348.            (and (frame-visible-p s1)
  349.             (frame-totally-visible-p s1)))))))
  350.  
  351. (defun get-frame-for-buffer-make-new-frame (buffer &optional frame-name)
  352.   (let* ((fr (make-frame (and frame-name (list (cons 'name frame-name)))))
  353.      (w (frame-root-window fr)))
  354.     ;;
  355.     ;; Make the one buffer being displayed in this newly created
  356.     ;; frame be the buffer of interest, instead of something
  357.     ;; random, so that it won't be shown in two-window mode.
  358.     ;; Avoid calling switch-to-buffer here, since that's something
  359.     ;; people might want to call this routine from.
  360.     ;;
  361.     ;; (If the root window doesn't have a buffer, then that means
  362.     ;; there is more than one window on the frame, which can only
  363.     ;; happen if the user has done something funny on the frame-
  364.     ;; creation-hook.  If that's the case, leave it alone.)
  365.     ;;
  366.     (if (window-buffer w)
  367.     (set-window-buffer w buffer))
  368.     fr))
  369.  
  370. (defun get-frame-for-buffer-noselect (buffer
  371.                        &optional not-this-window-p on-frame)
  372.   "Return a frame in which to display BUFFER.
  373. This is a subroutine of `get-frame-for-buffer' (which see)."
  374.   (let (name limit)
  375.     (cond
  376.      ((or on-frame (eq (selected-window) (minibuffer-window)))
  377.       ;; don't switch frames if a frame was specified, or to list
  378.       ;; completions from the minibuffer, etc.
  379.       nil)
  380.  
  381.      ((setq name (get-frame-name-for-buffer buffer))
  382.       ;;
  383.       ;; This buffer's mode expressed a preference for a frame of a particular
  384.       ;; name.  That always takes priority.
  385.       ;;
  386.       (let ((limit (get name 'instance-limit))
  387.         (matching-frames '())
  388.         frames frame already-visible)
  389.     ;; Sort the list so that iconic frames will be found last.  They
  390.     ;; will be used too, but mapped frames take precedence.  And
  391.     ;; fully visible frames come before occluded frames.
  392.     (setq frames (get-frame-for-buffer-sorted-frame-list))
  393.     ;; but the selected frame should come first, even if it's occluded,
  394.     ;; to minimize thrashing.
  395.     (setq frames (cons (selected-frame)
  396.                (delq (selected-frame) frames)))
  397.     
  398.     (setq name (symbol-name name))
  399.     (while frames
  400.       (setq frame (car frames))
  401.       (if (equal name (frame-name frame))
  402.           (if (get-buffer-window buffer frame)
  403.           (setq already-visible frame
  404.             frames nil)
  405.         (setq matching-frames (cons frame matching-frames))))
  406.       (setq frames (cdr frames)))
  407.     (cond (already-visible
  408.            already-visible)
  409.           ((or (null matching-frames)
  410.            (eq limit 0) ; means create with reckless abandon
  411.            (and limit (< (length matching-frames) limit)))
  412.            (get-frame-for-buffer-make-new-frame buffer name))
  413.           (t
  414.            ;; do not switch any of the window/buffer associations in an
  415.            ;; existing frame; this function only picks a frame; the
  416.            ;; determination of which windows on it get reused is up to
  417.            ;; display-buffer itself.
  418. ;;           (or (window-dedicated-p (selected-window))
  419. ;;           (switch-to-buffer buffer))
  420.            (car matching-frames)))))
  421.  
  422.      ((setq limit get-frame-for-buffer-default-instance-limit)
  423.       ;;
  424.       ;; This buffer's mode did not express a preference for a frame of a
  425.       ;; particular name, but the user wants a new frame rather than
  426.       ;; reusing the existing one.
  427.       (let ((frames (get-frame-for-buffer-sorted-frame-list)))
  428.     ;; put the selected frame last.  The user wants a new frame,
  429.     ;; so don't reuse the existing one unless forced to.
  430.     (setq frames (append (delq (selected-frame) frames) (list frames)))
  431.     (if (or (eq limit 0) ; means create with reckless abandon
  432.         (< (length frames) limit))
  433.         (get-frame-for-buffer-make-new-frame buffer)
  434.       (car frames))))
  435.  
  436.      (t
  437.       ;;
  438.       ;; This buffer's mode did not express a preference for a frame of a
  439.       ;; particular name.  So try to find a frame already displaying this
  440.       ;; buffer.  
  441.       ;;
  442.       (let ((w (or (get-buffer-window buffer t)        ; check visible first
  443.            (get-buffer-window buffer t t))))    ; then iconic
  444.     (cond ((null w)
  445.            ;; It's not in any window - return nil, meaning no frame has
  446.            ;; preference.
  447.            nil)
  448.           ((and not-this-window-p
  449.             (eq (selected-frame) (window-frame w)))
  450.            ;; It's in a window, but on this frame, and we have been
  451.            ;; asked to pick another window.  Return nil, meaning no
  452.            ;; frame has preference.
  453.            nil)
  454.           (t
  455.            ;; Otherwise, return the frame of the buffer's window.
  456.            (window-frame w))))))))
  457.  
  458.  
  459. ;; The pre-display-buffer-function is called for effect, so this needs to
  460. ;; actually select the frame it wants.  Fdisplay_buffer() takes notice of
  461. ;; changes to the selected frame.
  462. (defun get-frame-for-buffer (buffer &optional not-this-window-p on-frame)
  463.   "Select and return a frame in which to display BUFFER.
  464. Normally, the buffer will simply be displayed in the current frame.
  465. But if the symbol naming the major-mode of the buffer has a 'frame-name
  466. property (which should be a symbol), then the buffer will be displayed in
  467. a frame of that name.  If there is no frame of that name, then one is
  468. created.  
  469.  
  470. If the major-mode doesn't have a 'frame-name property, then the frame
  471. named by `get-frame-for-buffer-default-frame-name' will be used.  If
  472. that is nil (the default) then the currently selected frame will used.
  473.  
  474. If the frame-name symbol has an 'instance-limit property (an integer)
  475. then each time a buffer of the mode in question is displayed, a new frame
  476. with that name will be created, until there are `instance-limit' of them.
  477. If instance-limit is 0, then a new frame will be created each time.
  478.  
  479. If a buffer is already displayed in a frame, then `instance-limit' is 
  480. ignored, and that frame is used.
  481.  
  482. If the frame-name symbol has a 'frame-defaults property, then that is
  483. prepended to the `default-frame-alist' when creating a frame for the
  484. first time.
  485.  
  486. This function may be used as the value of `pre-display-buffer-function', 
  487. to cause the display-buffer function and its callers to exhibit the above
  488. behavior."
  489.   (let ((old-frames (visible-frame-list))
  490.     (frame (get-frame-for-buffer-noselect
  491.          buffer not-this-window-p on-frame)))
  492.     (if (not (eq frame (selected-frame)))
  493.     nil
  494.       (select-frame frame)
  495.       (or (member frame old-frames)
  496.         ;; If the frame was already visible, just focus on it.
  497.         ;; If it wasn't visible (it was just created, or it used
  498.         ;; to be iconified) then uniconify, raise, etc.
  499.       (make-frame-visible frame))
  500.       frame)))
  501.  
  502. (defun frames-of-buffer (&optional buffer visible-only)
  503.   "Return list of frames that BUFFER is currently being displayed on.
  504. If the buffer is being displayed on the currently selected frame, that frame
  505. is first in the list.  VISIBLE-ONLY will only list non-iconified frames."
  506.   (let ((list (windows-of-buffer buffer))
  507.     (cur-frame (selected-frame))
  508.     next-frame frames save-frame)
  509.  
  510.     (while list
  511.       (if (memq (setq next-frame (window-frame (car list)))
  512.         frames)
  513.       nil
  514.     (if (eq cur-frame next-frame)
  515.         (setq save-frame next-frame)
  516.       (and 
  517.        (or (not visible-only)
  518.            (eq t (frame-visible-p next-frame)))
  519.        (setq frames (append frames (list next-frame))))))
  520.     (setq list (cdr list)))
  521.  
  522.     (if save-frame
  523.     (append (list save-frame) frames)
  524.       frames)))
  525.  
  526. (defun show-temp-buffer-in-current-frame (buffer)
  527.   "For use as the value of temp-buffer-show-function:
  528. always displays the buffer in the current frame, regardless of the behavior
  529. that would otherwise be introduced by the `pre-display-buffer-function', which
  530. is normally set to `get-frame-for-buffer' (which see)."
  531.   (let ((pre-display-buffer-function nil)) ; turn it off, whatever it is
  532.     (let ((window (display-buffer buffer)))
  533.       (if (not (eq (selected-frame) (window-frame window)))
  534.       ;; only the pre-display-buffer-function should ever do this.
  535.       (error "display-buffer switched frames on its own!!"))
  536.       (setq minibuffer-scroll-window window)
  537.       (set-window-start window 1) ; obeys narrowing
  538.       (set-window-point window 1)
  539.       nil)))
  540.  
  541. (setq pre-display-buffer-function 'get-frame-for-buffer)
  542. (setq temp-buffer-show-function 'show-temp-buffer-in-current-frame)
  543.  
  544.  
  545. ;; from Bob Weiner <bweiner@pts.mot.com>, modified by Ben Wing
  546. (defun delete-other-frames (&optional frame)
  547.   "Delete all but FRAME (or the selected frame)."
  548.   (interactive)
  549.   (mapcar 'delete-frame (delq (or frame (selected-frame)) (frame-list))))
  550.  
  551.  
  552. (provide 'frame)
  553.  
  554. ;;; frame.el ends here
  555.